const route = require('koa-router')();
const User = require('../../model/user/user.js')
const bill = require('../../model/bill/bill.js')

route.post('/user_info',async(ctx,next)=>{
    let info = await User.findOne({user_id:ctx.request.body.user_id})
    ctx.body = {
        code:200,
        data:{
            mobile:info.mobile,
            openid:info.openid,
            avatarUrl:info.avatarUrl,
            user_name:info.user_name,
            sex:info.sex,
            user_id:info.user_id
        }
    }
    // let info = await bill.find({
    //     addDate:{
    //         '$gt':new Date('2020-1-1')
    //     }
    // }).sort({'addDate':1})
    // console.log(info)
    // ctx.body = {
    //     code:200,
    //     data:info
    // }
})

module.exports = route